//
//  WYWSqliteModelTool.h
//  SQlite
//
//  Created by Mr.Run on 2017/11/13.
//  Copyright © 2017年 Mr.Run. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WYWModelProtocol.h"

typedef NS_ENUM(NSUInteger, ColumnNameToValueRelationType) {
    ColumnNameToValueRelationTypeMore,
    ColumnNameToValueRelationTypeLess,
    ColumnNameToValueRelationTypeEqual,
    ColumnNameToValueRelationTypeMoreEqual,
    ColumnNameToValueRelationTypeLessEqual
};

@interface WYWSqliteModelTool : NSObject

+(BOOL)createTable:(Class)cls uid:(NSString *)uid;

+(BOOL)isTableRequiredUpdated:(Class)cls uid:(NSString *)uid;

+(BOOL)updateTable:(Class)cls uid:(NSString *)uid;

+(BOOL)saveOrUpdateModel:(id)model uid:(NSString *)uid;

+(BOOL)deleteModel:(id)model uid:(NSString *)uid;

+(BOOL)deleteModel:(Class)cls whereStr:(NSString *)whereStr uid:(NSString *)uid;

+(BOOL)deleteModel:(Class)cls columnName:(NSString *)columnName relation:(ColumnNameToValueRelationType)relation value:(id)value uid:(NSString *)uid;

//+(BOOL)deletWithSql:(NSString *)sql uid:(NSString *)uid;

//+(BOOL)deleteModels:(Class)cls columnName:(NSArray *)columnNames relation:(NSArray *)relations value:(NSArray *)values uid:(NSArray *)uid;

+(NSArray *)queryAllModels:(Class)cls uid:(NSString *)uid;

+(NSArray *)queryModels:(Class)cls columnName:(NSString *)columnName relation:(ColumnNameToValueRelationType)relation value:(id)value uid:(NSString *)uid;

+(NSArray *)queryModels:(Class)cls withSql:(NSString *)sql uid:(NSString *)uid;


@end
